syslib.ui.fx.Resize = {
	setHeight : function(element, height, lastHeight){
		// get the element height
		var currentHeight = element.offsetHeight;
		
		// calcule the modification size
		var modificationHeight = (height - currentHeight) / 5;
		var newHeight = currentHeight + modificationHeight;
		
		if(newHeight == lastHeight){
			// set the height of the element to the final level
			element.style.height = height + "px";
		} else {
			// set the height of the elemen
			element.style.height = newHeight + "px";
			
			// set the interval
			setTimeout(function(){
				syslib.ui.fx.Resize.setHeight(element, height, newHeight);
			}, 20);
		}
	}, 
	setWidth : function(element, width, lastWidth){
		// get the element width
		var currentWidth = element.offsetWidth;
		
		// calcule the modification size
		var modificationWidth = (width - currentWidth) / 5;
		var newWidth = currentWidth + modificationWidth;
		
		if(newWidth == lastWidth){
			// set the height of the element to the final level
			element.style.width = width + "px";
		} else {
			// set the height of the elemen
			element.style.width = newWidth + "px";
			
			// set the interval
			setTimeout(function(){
				syslib.ui.fx.Resize.setWidth(element, width, newWidth);
			}, 20);
		}
	}, 
	setSize : function(element, size, lastSize){
		// get the element width and height
		var currentHeight = element.offsetHeight;
		var currentWidth = element.offsetWidth;
		
		// calcule the space to move
		var modificationHeight = (size.height - currentHeight) / 5;
		var newHeight = currentHeight + modificationHeight;
		var modificationWidth = (size.width - currentWidth) / 5;
		var newWidth = currentWidth + modificationWidth;
		
		if(newHeight == lastSize.height && newWidth == lastSize.width){
			// move the element to the final position
			syslib.element.updateStyle({
				height : size.height, 
				width : size.width
			});
		} else {
			// move the element
			syslib.element.updateStyle({
				height : newHeight + "px",
				width : newWidth + "px"
			});
			
			// set the interval
			setTimeout(function(){
				syslib.ui.fx.Resize.setSize(element, size, {
					width: newWidth, 
					height: newHeight
				});
			}, 20);
		}
	
	}
};